#!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time    : 2023/9/5 0:31
# @Author  : BadMan
# @FileName: 04_爬取堆糖壁纸.py
import requests
import re
from bs4 import BeautifulSoup
#
# def getHTMLText(url):
#     try:
#         re = requests.get(url)
#         re.raise_for_status()  # 若返回不是200，抛出Html异常
#         re.encoding = re.apparent_encoding
#         return re.text
#     except:
#         print("获取请求失败")
#
# def parsePage(url,html):
#     try:
#         pass
#     except:
#         pass
#
# def printList(list_info):
#     pass
# if __name__ == '__main__':
#     key_word = "鬼灭之刃"
#     start_url = "https://www.duitang.com/search/?kw" + key_word
#     depth = 3  # 获取3✌
#     info_list = []
#     # getHTMLText(start_url)
#     # for i in range(depth):
#     #     try:
#     #         url = start_url + "&type=feed#!s-p" + str(i)
#     #         # print(requests.get(url).status_code)
#     #         html = getHTMLText(url)
#     #         parsePage(info_list,html)
#     #     except:
#     #         continue
#     #     printList(info_list)
#     # re = requests.get(start_url)
#     # print(re.status_code)

